#include <iostream>
#include <string>
#include <vector>
#include <functional>

void print(const std::string &str, int num){
    std::cout << str << ' ' << num << std::endl;
}

/* bind 的使用 */
int main(void){
    using Task = std::function<void()>;
    std::vector<Task> array;
    array.push_back(std::bind(print, "hello", 10));
    array.push_back(std::bind(print, "leihou", 20));
    array.push_back(std::bind(print, "leihao", 30));
    array.push_back(std::bind(print, "nihao", 40));

    for(auto &f : array) f();

    return 0;
}

